Skip to content

Conversation

@RafaelKayumov
Copy link
Contributor

@RafaelKayumov RafaelKayumov commented Sep 23, 2025

Part of: WOOMOB-1236

Description

The PR adds the draft for a "Booking details" screen. The added view and view model is currently a skeleton and doesn't yet have a data binding.
The view and view controller is not yet used in the app. To check out the appearance - use the Xcode, navigate to the BookingDetailsView file and open the canvas with a preview.
Current PR only implements the header section and the "Appointment details" section. Other sections and data binding will be implemented in the upcoming PRs.

  • Adds BookingDetailsViewController has hosting view controller for BookingDetailsView
  • Adds BookingDetailsView as SwiftUI view carrying the screen content
  • Adds BookingDetailsViewModel representing the view state of a booking details screen.
  • Updates TitleAndTextFieldRow to have configurable title and value fonts and color. Reuses it for content rows in "Appointment details" section.

Steps to reproduce

N/A

Testing information

To check out the current appearance - use the Xcode, navigate to the BookingDetailsView file and open the canvas with a preview.

Screenshots

Снимок экрана 2025-09-25 в 23 52 47
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@RafaelKayumov RafaelKayumov added this to the 23.4 milestone Sep 23, 2025
@RafaelKayumov RafaelKayumov added the type: task An internally driven task. label Sep 23, 2025
@dangermattic
Copy link
Collaborator

dangermattic commented Sep 23, 2025

1 Warning
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 23, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Numberpr16168-93d2f67
Version23.3
Bundle IDcom.automattic.alpha.woocommerce
Commit93d2f67
Installation URL181rtjgda2e5g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Base automatically changed from woomob-1374-update-networking-layer-to-support-fetching-bookings to trunk September 24, 2025 08:29
@RafaelKayumov RafaelKayumov force-pushed the WOOMOB-1236-booking-details-screen branch from 238a3d3 to 0336bd1 Compare September 25, 2025 13:17
@RafaelKayumov RafaelKayumov marked this pull request as ready for review September 25, 2025 20:54
@RafaelKayumov RafaelKayumov changed the title Woomob 1236 booking details screen [Bookings] Booking details screen Sep 25, 2025
@RafaelKayumov RafaelKayumov changed the title [Bookings] Booking details screen [Bookings][Part 1] Booking details screen Sep 25, 2025
@itsmeichigo itsmeichigo self-assigned this Sep 26, 2025
Copy link
Contributor

@itsmeichigo itsmeichigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 I left some nit-picking in the comments.

import SwiftUI

/// periphery: ignore - will be used after Booking list is ready
final class BookingDetailsViewController: UIHostingController<BookingDetailsView> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the BookingDetailsView directly in BookingTabView? If so I think this hosting controller would be redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed host vc in 7b45174

Comment on lines 31 to 34
let appointmentDate = Self.appointmentDateFormatter.string(from: booking.startDate)
let appointmentTimeFrame = [
Self.appointmentTimeFrameFormatter.string(from: booking.startDate),
Self.appointmentTimeFrameFormatter.string(from: booking.endDate)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: these can be simplified:

Suggested change
let appointmentDate = Self.appointmentDateFormatter.string(from: booking.startDate)
let appointmentTimeFrame = [
Self.appointmentTimeFrameFormatter.string(from: booking.startDate),
Self.appointmentTimeFrameFormatter.string(from: booking.endDate)
let appointmentDate = booking.startDate.formatted(date: .numeric, time: .omitted)
let appointmentTimeFrame = [
booking.startDate.formatted(date: .omitted, time: .shortened),
booking.endDate.formatted(date: .omitted, time: .shortened)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 1220ac5

)

let appointmentDetailsSection = Section(
headerText: "Appointment Details".uppercased(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: please ensure to localize this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added localizations in 9a19487

let status: [Status]

init(_ booking: Booking) {
bookingDate = Self.dateFormatter.string(from: booking.startDate)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: similar comment as above about formatting date in a simpler way.

}

var body: some View {
RefreshablePlainList(action: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this type seems outdated. Since we're targeting iOS 17 minimum now, please consider using ScrollView with refreshable for simplicity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in aa85786

@RafaelKayumov RafaelKayumov merged commit 5266e5b into trunk Sep 26, 2025
13 checks passed
@RafaelKayumov RafaelKayumov deleted the WOOMOB-1236-booking-details-screen branch September 26, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants